package com.bona.core.appserver;

import java.io.IOException;
import java.util.Map;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.bona.cache.ICache;

public class CacheStart { 
	
	private static final String SPRING_CONFIG_XML = "spring-context.xml";
	private static final String SPRINT_JEDIS_XML = "spring-redis.xml";

	public static void main(String[] args) throws IOException {
        
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        		new String[] {SPRING_CONFIG_XML, SPRINT_JEDIS_XML});
        context.start();
        
        Map<String, ICache> chacheMap = context.getBeansOfType(ICache.class);
        for (ICache iCache: chacheMap.values()) {
        	iCache.putData();
        }
        context.close();
    }
}
